package cn.com.hfuu;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

@SuppressWarnings("all")
public class SystemUtil {

	private String datetime;

	public String getDatetime() {
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		datetime = sdf.format(date);
		return datetime;
	}
 

	public List listset(List l) {
		Set set = new HashSet();
		List newList = new ArrayList();
		for (Iterator iter = l.iterator(); iter.hasNext();) {
			Object element = iter.next();
			if (set.add(element)){
				newList.add(element);
			}
				
		}
		l.clear();
		l.addAll(newList);
		System.out.println(set.toString());
		return l;
	}

}
